package com.gccloud.design.feign;

import com.gccloud.design.entity.SysDictItemEntity;
import com.gccloud.feign.filter.FeignRequestFilter;
import com.gccloud.starter.common.vo.R;
import com.gccloud.starter.core.dto.SysDictItemDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author hu.hongdou
 * @date 2021/6/18 10:52
 */
@FeignClient(name = "ofm-base", path = "/baseCenter", contextId = "test2", configuration = {FeignRequestFilter.class})
public interface DictClient {

    /**
     * 实现功能：业务字典feignAPI
     *
     * @param dictCode 字典编码
     * @return 业务字典项集合
     */
    @RequestMapping(value = "/sys/dict-item/getByCode")
    R<List<SysDictItemEntity>> getByDictCode(@RequestParam("dictCode") String dictCode);

    @PostMapping(value = "/sys/dict-item")
    R<String> add(@RequestBody SysDictItemDTO dictItemDTO);

    @PostMapping(value = "/sys/dict-item/{value}")
    R<String> deleteByValue(@PathVariable("value") String value);

}
